package com.woniu.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniu.entity.VaTask;
import com.woniu.mapper.VaTaskMapper;
import com.woniu.service.VaTaskService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

/**
* @author nanqiao
* @description 针对表【va_task】的数据库操作Service实现
* @createDate 2025-06-17 19:20:14
*/
@Service
public class VaTaskServiceImpl extends ServiceImpl<VaTaskMapper, VaTask>
    implements VaTaskService{
    @Resource
    private VaTaskMapper vaTaskMapper;

    @Override
    public List<Integer> getTaskIdsByCreator(String creator) {
        return ((VaTaskMapper)baseMapper).selectTaskIdsByCreator(creator);
    }
    /**
     * 通过用户ID查询关联的任务
     * 直接调用Mapper层自定义的联表查询方法
     * 此处不添加缓存，因为任务数据可能频繁更新
     * @param userId 用户ID
     * @return 任务列表
     */
    @Override
    public List<VaTask> listByUserId(Integer userId) {
        // 参数校验，避免空指针异常
        if (userId == null) {
            return null;
        }
        return vaTaskMapper.listByUserId(userId);
    }
}






